<?php
include_once($relPath.'site_vars.php');
// include_once($relPath.'project_states.inc');
include_once($relPath.'list_projects.inc');

function showstartexts($etext_limit, $type) 
{
    global $Context;
    global $site_url, $dpdb;

    switch($type)
    {
        case "bronze":
            // $state = SQL_CONDITION_BRONZE;
            $total = $Context->ProjectsProofingCount();
            $content = "proofing";
            $category = _("%s in Proofreading");
            $description = _("These books are being processed 
                through our site; sign in and start helping!");
            break;
    
        case "silver": 
            // $state = SQL_CONDITION_SILVER;
            $total = $Context->ProjectsPPCount();
            $content = "postprocessing";
            $category = _("%s In Progress");
            $description = _("These books are being assembled 
                    into a completed e-book.");
            break;

        case "gold": 
            // $state = SQL_CONDITION_GOLD;
            $total = $Context->ProjectsPostedCount();
            $content="posted";
            $category = _("%s in Completed");
            $description =  _("These books have been 
                posted to the Project Gutenberg archive.");
            break;

        default:
            return;
    }

    // Display star graphic
    echo "<img src='$site_url/graphics/{$type}_star.jpg' 
                                        alt='$type star'>\n";

    // Display count and category as a link
    echo "<h3 class='subhead'>";
    echo "<a href='list_etexts.php?metal=$type&amp;sort=5'>";
    echo sprintf($category, number_format($total)) 
        . "</a>.</h3><br>\n";

    // Display feed buttons
    echo "
        <a href='$site_url/feeds/backend.php?content=$content'>
        <img src='$site_url/graphics/xml.gif' alt='[XML]'></a>
        <a href='$site_url/feeds/backend.php?content=$content&amp;type=rss'>
        <img src='$site_url/graphics/rss.gif' alt='[RSS]'></a>
	\n";

    // Display description text
    echo "<p>$description</p>";
}

// vim: sw=4 ts=4 expandtab
?>
